<p class=titulo align="center"><? echo $msg->get('XML_TITLE_GERA'); ?></p>
<p class=titulo align="center"><? echo $msg->get('XML_TITLE_AJDADOS'); ?></p>
<p class=titulo align="center"><? echo $msg->get('XML_GERA_AJDADOS_SUBTITLE_1'); ?></p>
<p>
<?
	require_once("verifica.php");
	include_once("config.php");
?>

<? if (strlen(@$arquivo)==0) { ?>

		<br>
		<p align="left"><? echo $msg->get('XML_GERA_MSG01'); ?></p>
		<br>
		<form enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
        <input type="radio" name="arquivo" value="nao" unchecked><? echo $msg->get('XML_GERA_MSG02'); ?><br>
        <input type="radio" name="arquivo" value="sim" unchecked><? echo $msg->get('XML_GERA_MSG03'); ?><br>
        <input type="radio" name="arquivo" value="alt" unchecked><? echo $msg->get('XML_GERA_MSG12'); ?><br>
        <input type="radio" name="arquivo" value="del" unchecked><? echo $msg->get('XML_GERA_MSG13'); ?><p>
		<input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_NEXT'); ?>>
		</form>

<? } else if (($arquivo=="sim")&((strlen(@$text_file)==0)||(!file_exists(@$text_file)))&(@$file_read!="ok")) { ?>

		<br>
		<p align="left"><? echo $msg->get('XML_GERA_MSG04'); ?>
		<br>
		<form enctype=multipart/form-data action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
		<a href=javascript:winopen('ajuda/ajdados1.php?idioma=PT_BR.php')><? echo $msg->get('XML_GERA_MSG05'); ?></a><p>
		<input type="file" name="text_file"><p>
		<? if ((strlen($text_file)!=0)&(!file_exists($text_file))) { ?>
              <? echo $msg->get('XML_GERA_MSG06'); ?>
        <? } ?>
		<input type="hidden" name="arquivo" value="<? echo $arquivo ?>">
		<input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_NEXT'); ?>>
		</form>
<? } else if (@$arquivo == "alt") {
        $usr_file = $_SESSION['ANAWEB']->RetornaArquivoBiblioteca();
        if (file_exists($usr_file))
        {
            $obj = DOMDocument::load($usr_file);
            if (!isset($_GET['alterar']) && !isset($_POST['alterar']))
            {
                $filhos = $obj->getelementsbytagname("datafit");
?>
            <?php echo $msg->get('Selecione_Exemplo_Alterado') ?><br><br>
            <form action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
                <input type="hidden" name="arquivo" value="alterar">
<?php
                $i = 1;
                if ($filhos->length)
                {
                    foreach ($filhos as $filho)
                    {
                        echo "<p><a href=\"index.php?inc=gera_prob_ajdados1_xml.php&arquivo=alt&alterar=".($i-1)."\"><u>".$msg->get('Exemplo')." ". $i++."</u></a></p>";
                    }
                }
?>
            </form>
<?php
            }
            elseif (!@$Submit)
            {
                $filhos = $obj->getelementsbytagname("datafit");
                $filho = $filhos->item($alterar);
                $desc = $filho->getelementsbytagname("description")->item(0)->nodeValue;
                $com = $filho->getelementsbytagname("comments")->item(0)->nodeValue;
                $ref = $filho->getelementsbytagname("reference")->item(0)->nodeValue;
                $dados = $filho->getelementsbytagname("options")->item(0)->getAttribute("data");
                $grau = $filho->getElementsByTagname("degree")->item(0)->nodeValue;
?>
        <form enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">

        <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG09'); ?>
        <input type="text" size='5' maxlength='8' name="grau" value="<? echo @$grau ?>">
<?php
                if ($dados == "discrete")
                {
                    $n = $filho->getElementsByTagname("num_points")->item(0)->nodeValue;
                    $pontos = $filho->getElementsByTagname("point");
                    for ($i = 0; $i < $n; $i++)
                    {
                        $X[$i] = $pontos->item($i)->getElementsByTagname("x")->item(0)->nodeValue;
                        $Y[$i] = $pontos->item($i)->getElementsByTagname("y")->item(0)->nodeValue;
                    }
?>
        <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG08'); ?>
        <br><br>
        <table>
            <tr>
               <td align="center">x</td>
               <td align="center"><b>,</b></td>
               <td align="center">y</td>
            </tr>
        <? for ($i=0; $i<$n; $i++) { ?>
            <tr><td>
            <input type="text" size="5" maxlength="30" name="X[<? echo $i ?>]" value="<? echo @$X[$i] ?>"></td><td><b>,</b></td><td>
            <input type="text" size="5" maxlength="30" name="Y[<? echo $i ?>]" value="<? echo @$Y[$i] ?>"></td></tr>
        <? } ?>
        </table>
<?php
                }
                else
                {
                    $funcao = $filho->getElementsByTagname("function")->item(0)->nodeValue;
                    $interval = $filho->getElementsByTagname("interval")->item(0);
                    $a = $interval->getElementsByTagname("x")->item(0)->nodeValue;
                    $b = $interval->getElementsByTagname("y")->item(0)->nodeValue;
?>
        <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG05'); ?>
        <p align="left">f(x) = 
        <input type="text" size='60' maxlength='100' name="funcao" value="<? echo @$funcao ?>">
        <a href=javascript:winopen('ajuda/funcoesphp.php?idioma=PT_BR.php')><? echo $msg->get('XML_GERA_AJDADOS_MSG011'); ?></a>
        <p>
        <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG06'); ?> [
            <input type="text" size='5' maxlength='5' name="a" value="<?echo @$a ?>"><b>,</b><input type="text" size='5' maxlength='5' name="b" value="<?echo @$b ?>">
        ]
        <p>
<?php
                }
?>
        <p>
        <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG010'); ?><br>
        <input type="text" size='50' maxlength='50' name="desc" value="<? echo @$desc ?>">
        <p>
        <p align="left"><? echo $msg->get('XML_GERA_MSG08'); ?><br>
        <TEXTAREA name="com" cols="50" rows="3"><? echo @$com ?></TEXTAREA>
        <p>
        <p align="left"><? echo $msg->get('XML_GERA_MSG09'); ?><br>
        <TEXTAREA name="ref" cols="50" rows="3"><? echo @$ref ?></TEXTAREA>
        <p>
        <input type="hidden" name="arquivo" value="<? echo @$arquivo ?>">
        <input type="hidden" name="alterar" value="<?php echo @$alterar ?>">
        <input type="hidden" name="dados" value="<? echo @$dados ?>">
        <input type="hidden" name="n" value="<? echo @$n ?>">
        <input type="hidden" name="file_read" value="<? echo @$file_read ?>">
        <input class="button" type="submit" name="Submit" value="<? echo $msg->get('XML_GERA_MSG010'); ?>">
        </form>
<?php
            }
            else
            {
                $filhos = $obj->getelementsbytagname("datafit");
                $filho = $filhos->item($alterar);
                $filho->getelementsbytagname("description")->item(0)->nodeValue = $_POST['desc'];
                $filho->getelementsbytagname("comments")->item(0)->nodeValue = $_POST['com'];
                $filho->getelementsbytagname("reference")->item(0)->nodeValue = $_POST['ref'];
                $filho->getElementsByTagname("degree")->item(0)->nodeValue = $_POST['grau'];
                if ($dados == "discrete")
                {
                    $n = $filho->getElementsByTagname("num_points")->item(0)->nodeValue;
                    $pontos = $filho->getElementsByTagname("point");
                    for ($i = 0; $i < $n; $i++)
                    {
                        $pontos->item($i)->getElementsByTagname("x")->item(0)->nodeValue = $_POST['X'][$i];
                        $pontos->item($i)->getElementsByTagname("y")->item(0)->nodeValue = $_POST['Y'][$i];
                    }
                }
                else
                {
                    $filho->getElementsByTagname("function")->item(0)->nodeValue = $_POST['funcao'];
                    $interval = $filho->getElementsByTagname("interval")->item(0);
                    $interval->getElementsByTagname("x")->item(0)->nodeValue = $_POST['a'];
                    $interval->getElementsByTagname("y")->item(0)->nodeValue = $_POST['b'];
                }
                $obj->save($usr_file);
            }
        }
        else //nao tem biblioteca
        {
        }
 } else if ($arquivo == "del")
 {
    $usr_file = $_SESSION['ANAWEB']->RetornaArquivoBiblioteca();
    if (file_exists($usr_file))
    {
        $obj = DOMDocument::load($usr_file);
        if (!isset($_GET['remover']) && !isset($_POST['remover']))
        {
            $filhos = $obj->getelementsbytagname("datafit");
?>
        <?php echo $msg->get('Selecione_Exemplo_Removido') ?><br><br>
        <form action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
            <input type="hidden" name="arquivo" value="alterar">
<?php
            $i = 1;
            if ($filhos->length)
            {
                foreach ($filhos as $filho)
                {
                    echo "<p><a href=\"index.php?inc=gera_prob_ajdados1_xml.php&arquivo=del&remover=".($i-1)."\"><u>".$msg->get('Exemplo')." ". $i++."</u></a></p>";
                }
            }
?>
        </form>
<?php
        } //if (!isset($_GET['remover']) && !isset($_POST['remover']))
        elseif (!isset($_POST['Submit']))
        {
                $filhos = $obj->getelementsbytagname("datafit");
                $filho = $filhos->item($remover);
                $desc = $filho->getelementsbytagname("description")->item(0)->nodeValue;
                $com = $filho->getelementsbytagname("comments")->item(0)->nodeValue;
                $ref = $filho->getelementsbytagname("reference")->item(0)->nodeValue;
                $dados = $filho->getelementsbytagname("options")->item(0)->getAttribute("data");
                $grau = $filho->getElementsByTagname("degree")->item(0)->nodeValue;
                if ($dados == "discrete")
                {
                    $n = $filho->getElementsByTagname("num_points")->item(0)->nodeValue;
                    $pontos = $filho->getElementsByTagname("point");
                    for ($i = 0; $i < $n; $i++)
                    {
                        $X[$i] = $pontos->item($i)->getElementsByTagname("x")->item(0)->nodeValue;
                        $Y[$i] = $pontos->item($i)->getElementsByTagname("y")->item(0)->nodeValue;
                    }
                }
                else
                {
                    $funcao = $filho->getElementsByTagname("function")->item(0)->nodeValue;
                    $interval = $filho->getElementsByTagname("interval")->item(0);
                    $a = $interval->getElementsByTagname("x")->item(0)->nodeValue;
                    $b = $interval->getElementsByTagname("y")->item(0)->nodeValue;
                }
?>
        <p>Tem certeza que deseja excluir o seguinte problema?</p>
        <form enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
        <p><? echo $msg->get('XML_GERA_AJDADOS_MSG09'); ?> <? echo @$grau ?></p>
<?php
                if ($dados == "discrete")
                {
?>
        <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG08'); ?>
        <br><br>
        <table>
            <tr>
               <td align="center">x</td>
               <td align="center"><b>,</b></td>
               <td align="center">y</td>
            </tr>
        <? for ($i=0; $i<$n; $i++) { ?>
            <tr><td align="center">
            <? echo @$X[$i] ?></td><td><b>,</b></td><td align="center">
            <? echo @$Y[$i] ?></td></tr>
        <? } ?>
        </table>
<?php
                }
                else
                {
?>
        <p><? echo $msg->get('XML_GERA_AJDADOS_MSG05'); ?>
        <p>f(x) = <? echo @$funcao ?></p>
        <p><? echo $msg->get('XML_GERA_AJDADOS_MSG06'); ?> [ <?php echo @$a ?><b>,</b><?php echo @$b ?> ]
        <p>
<?php
                }
?>
        <p>
        <p><? echo $msg->get('XML_GERA_AJDADOS_MSG010'); ?> <?php echo @$desc ?></p>
        <p><? echo $msg->get('XML_GERA_MSG08'); ?> <? echo @$com ?></p>
        <p><? echo $msg->get('XML_GERA_MSG09'); ?> <? echo @$ref ?></p>
        <input type="hidden" name="arquivo" value="<? echo @$arquivo ?>">
        <input type="hidden" name="remover" value="<?php echo @$remover ?>">
        <input class="button" type="submit" name="Submit" value="<? echo $msg->get('XML_GERA_MSG15'); ?>">
        </form>
<?php
        } //elseif (!isset($_POST['Submit']))
        else
        {
            $pai = $obj->getElementsByTagname("datafitting");
            $filhos = $pai->item(0)->getelementsbytagname("datafit");
            $filho = $filhos->item($remover);
            $remover = $pai->item(0)->removeChild($filho);
            $obj->save($usr_file);
        } //else --> if (!isset($_GET['remover']) && !isset($_POST['remover'])) | elseif (!isset($_POST['Submit']))
    }
 } else if ((strlen(@$dados) == 0)&($arquivo=="nao"))  { ?>

		<br>
		<p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG01'); ?>
		<br>
		<form enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
		<input type="radio" name="dados" value="discrete" unchecked><? echo $msg->get('XML_GERA_AJDADOS_MSG02'); ?><br>
		<input type="radio" name="dados" value="continuous" unchecked><? echo $msg->get('XML_GERA_AJDADOS_MSG03'); ?><br>
		<br>
		<input type="hidden" name="arquivo" value="<? echo $arquivo ?>">
            <input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_NEXT'); ?>>
		</form>

<? } else if (((strlen(@$n) == 0) & ((strlen(@$funcao) == 0) or (strlen(@$a)==0) or (strlen(@$b)==0)))&($arquivo=="nao")) { ?>

	    <form method=post enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php">
		<? if ($dados=="discrete") { ?>	   		          
		<p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG04'); ?>
		<input type="text" size='5' maxlength='5' name="n" value="<? echo @$n ?>">
		<br><br>
		<? } else { ?>	   		          
           		   <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG05'); ?>
			   <p align="left">f(x) = 
	   		   <input type="text" size='60' maxlength='100' name="funcao" value="<? echo @$funcao ?>">
			   <a href=javascript:winopen('ajuda/funcoesphp.php?idioma=PT_BR.php')><? echo $msg->get('XML_GERA_AJDADOS_MSG011'); ?></a>
			   <p>
  			   <p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG06'); ?> [
           		   <input type="text" size='5' maxlength='5' name="a" value="<?echo @$a ?>"><b>,</b><input type="text" size='5' maxlength='5' name="b" value="<?echo @$b ?>">
		  	   ]
			   <p>
        <? } ?>
		<input type="hidden" name="arquivo" value="<? echo @$arquivo ?>">
		<input type="hidden" name="dados" value="<? echo @$dados ?>">
		<input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_NEXT'); ?>>
		</form>

<? } else if (( ($dados=="discrete") & ((strlen(@$X[0])==0) or (strlen(@$Y[0])==0) or (!checaNumerico(@$X)) or (!checaNumerico(@$Y)) or (!verificaxcrescente(@$X,@$n))) )&($arquivo=="nao"))  { ?>
		<?
			if (isset($Y))
            {
                if (!checaNumerico(@$Y) || !checaNumerico(@$X))
                    echo "<font color=red><b>Os valores de entrada devem ser numericos</b>";
                if (!verificaxcrescente($X,$n))
                    echo "<br><font color=red><b>Os valores de x<sub>i</sub> devem estar em ordem crescente</b>";
            }
		?>
		<form enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
		<p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG07'); ?> <? echo @$n ?>
		<p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG08'); ?>
		<br><br>
		<table>
			<tr>
			   <td align="center">x</td>
			   <td align="center"><b>,</b></td>
			   <td align="center">y</td>
			</tr>
			<? for ($i=0; $i<$n; $i++) { ?>
	    		    <tr>
		  	       <td align="center">( <input type="text" size='5' maxlength='30' name="X[<? echo $i ?>]" value="<? echo @$X[$i] ?>"></td>
 				 <td align="center"><b>,</b></td>
	    		       <td align="center"><input type="text" size='5' maxlength='30' name="Y[<? echo $i ?>]" value="<? echo @$Y[$i] ?>"> )</td>
			    </tr>
			<? } ?>
		</table>
		<br>
		<input type="hidden" name="arquivo" value="<? echo @$arquivo ?>">
		<input type="hidden" name="dados" value="<? echo @$dados ?>">
		<input type="hidden" name="n" value="<? echo @$n ?>">
		<input type="hidden" name="funcao" value="<? echo @$funcao ?>">
		<input type="hidden" name="a" value="<? echo @$a ?>">
		<input type="hidden" name="b" value="<? echo @$b ?>">
		<input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_NEXT'); ?>>
		</form>

<? } else if  ( (strlen(@$grau)==0) or (strlen(@$desc)==0) or (!checaNumerico($grau))){ ?>

		<form enctype="multipart/form-data" action="index.php?inc=gera_prob_ajdados1_xml.php" method="post">
		
        <? if ((@$arquivo=="sim")&(@$file_read!="ok")) {
        $fp = fopen($text_file, "r");
		$vet_dados = file($text_file);
		$dados_temp = trim($vet_dados[0]); // 0 para caso discreto e 1 para caso continuo
		if ($dados_temp==0) $dados=discrete; else if ($dados_temp==1) $dados=continuos;
		$cont = 0;
		if ( $dados_temp == 0) {
		   $cont = $cont + 1;
		   $n = trim($vet_dados[$cont]);
		   for ($i=0; $i<$n; $i++){
			  $cont = $cont + 1;
			  list($X[$i],$Y[$i]) = explode(";",trim($vet_dados[$cont]));
           }
		}
		else if ($dados_temp == 1)  {
			  $cont = $cont + 1;
		      $funcao = trim($vet_dados[$cont]);
			  $cont = $cont + 1;
		  list($a,$b) = explode(";",trim($vet_dados[$cont]));
		}
		$cont = $cont + 1;
		$grau = trim($vet_dados[$cont]);
		fclose($fp);
		$file_read = ok;
		}
		if (isset($grau))
			echo "<font color=red><b>O valor para o grau deve ser num&eacute;rico</b>";
		?>

		<p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG09'); ?>
		<input type="text" size='5' maxlength='8' name="grau" value="<? echo @$grau ?>">
		<p>
		<p align="left"><? echo $msg->get('XML_GERA_AJDADOS_MSG010'); ?><br>
		<input type="text" size='50' maxlength='50' name="desc" value="<? echo @$desc ?>">
		<p>
		<p align="left"><? echo $msg->get('XML_GERA_MSG08'); ?><br>
		<TEXTAREA name="com" cols="50" rows="3"><? echo @$com ?></TEXTAREA>
		<p>
		<p align="left"><? echo $msg->get('XML_GERA_MSG09'); ?><br>
		<TEXTAREA name="ref" cols="50" rows="3"><? echo @$ref ?></TEXTAREA>
		<p>
		<input type="hidden" name="arquivo" value="<? echo @$arquivo ?>">
		<input type="hidden" name="dados" value="<? echo @$dados ?>">
		<input type="hidden" name="n" value="<? echo @$n ?>">
		<input type="hidden" name="funcao" value="<? echo @$funcao ?>">
		<input type="hidden" name="a" value="<? echo @$a ?>">
		<input type="hidden" name="b" value="<? echo @$b ?>">
 	    <input type="hidden" name="file_read" value="<? echo @$file_read ?>">
		<? for ($i=0; $i<$n; $i++) { ?>
  	       	<input type="hidden" name="X[<? echo $i ?>]" value="<? echo @$X[$i] ?>">
 			<input type="hidden" name="Y[<? echo $i ?>]" value="<? echo @$Y[$i] ?>">
		<? } ?>
		<input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_GERA_MSG010'); ?>>
		</form>

<? } else {

$id_demo=0;
//$usr_file = $DOCUMENT_ROOT."/user/".$id_usuario."/biblioteca.xml";
$usr_file = $_SESSION['ANAWEB']->RetornaArquivoBiblioteca();
$dem_file = $DOCUMENT_ROOT."/user/".$id_demo."/biblioteca.xml";


		//Funcoes DOMXML Versao => 2.4.21

		function xmlentities($xml)
		{
			$entities = array ('<' => '&lt;','&' => '&amp;',);
			if (is_string($xml)) { $xml = strtr($xml, $entities);};
			return $xml;
		}
function gera_bib($xml_file,$desc,$dados,$n,$X,$Y,$funcao,$a,$b,$grau,$com,$ref)
{
		if (file_exists($xml_file)) {
            $objeto = new DOMDocument();
            $objeto->preserveWhiteSpace=false;
            $objeto->load($xml_file);
		}
		else {
            $objeto = new DOMDocument('1.0');
		}
        $objeto->formatOutput=true;
        if ($objeto->getelementsbytagname("problems")->length == 0)
        {
            $raiz = $objeto->createElement("problems");
            $raiz = $objeto->appendChild($raiz);
        }
        $raiz = $objeto->getelementsbytagname("problems")->item(0);
		if ($objeto->getelementsbytagname("datafitting")->length == 0) {
            $filho = $objeto->createElement("datafitting");
            $filho = $raiz->appendChild($filho);
		}
        $filho = $objeto->getelementsbytagname("datafitting")->item(0);
        $datafit = $objeto->createElement("datafit");
        $datafit = $filho->appendChild($datafit);
        $description = $objeto->createElement("description",xmlentities(utf8_encode($desc)));
        $description = $datafit->appendChild($description);
        $options = $objeto->createElement("options");
        $options->setAttribute("data",$dados);
        $options = $datafit->appendChild($options);
		if ($dados=="discrete"){
            $pontos = $objeto->createElement("num_points",$n);
            $pontos = $datafit->appendChild($pontos);
			for($i = 0; $i < $n; $i++)
			{ 	$point = $objeto->createElement("point");
                $point = $datafit->appendChild($point);
                $x = $objeto->createElement("x",$X[$i]);
                $x = $point->appendChild($x);
                $y = $objeto->createElement("y",$Y[$i]);
                $y = $point->appendChild($y);
			}
		} else {
            $function = $objeto->createElement("function",xmlentities(utf8_encode($funcao)));
            $function = $datafit->appendChild($function);
		}
		if ((!strlen(@$a)==0)&(!strlen(@$b)==0)) {
            $interval = $objeto->createElement("interval");
            $interval = $datafit->appendChild($interval);
            $x = $objeto->createElement("x",$a);
            $x = $interval->appendChild($x);
            $y = $objeto->createElement("y",$b);
            $y = $interval->appendChild($y);
		}
        $dataf_val = $objeto->createElement("degree",$grau);
        $dataf_val = $datafit->appendChild($dataf_val);
		if (!strlen($com)==0) {
            $comen = $objeto->createElement("comments",xmlentities(utf8_encode($com)));
            $comen = $datafit->appendChild($comen);
		}
		if (!strlen($ref)==0) {
            $refer = $objeto->createElement("reference",xmlentities(utf8_encode($ref)));
            $refer = $datafit->appendChild($refer);
		}
        $objeto->save($xml_file);
}
gera_bib($usr_file,$desc,$dados,$n,$X,$Y,$funcao,$a,$b,$grau,$com,$ref);
//gera_bib($dem_file,$desc,$dados,$n,$X,$Y,$funcao,$a,$b,$grau,$com,$ref);
        ?>
		<p align="center"><? echo $msg->get('XML_GERA_MSG011'); ?></p>
        <?


} //end else

?>

		<form name="back" method="post" action="index.php?inc=gera_prob_ajdados1_xml.php">
		<input class="button" type="submit" name="Submit" value=<? echo $msg->get('XML_BEGIN'); ?>>
		</form>

</body>
</html>
